package cn.memorynine.consumer.controller;

import cn.memorynine.consumer.model.index.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import cn.memorynine.common.model.ResponseWrapper;
import cn.memorynine.consumer.service.IndexService;
import cn.memorynine.common.model.ResponseWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestBody;

/**
* 首页控制器
* @author 代码生成器
*/
@Slf4j
@RestController
@RequestMapping("/index")
public class IndexController {
    @Autowired
    private IndexService indexService;

    /**
     * 1.获取热门商品
     * @return
     */
    @RequestMapping("/HotCommondityList")
    public ResponseWrapper HotCommondityList(@RequestBody @Validated HotCommondityListParam param){
        return indexService.HotCommondityList(param);
    }

    /**
     * 2.获取热门帖子
     * @return
     */
    @RequestMapping("/HotPostList")
    public ResponseWrapper HotPostList(@RequestBody @Validated HotPostListParam param){
        return indexService.HotPostList(param);
    }

    /**
     * 3.获取热门活动
     * @return
     */
    @RequestMapping("/HotActivity")
    public ResponseWrapper HotActivity(@RequestBody @Validated HotActivityParam param){
        return indexService.HotActivity(param);
    }

}